namespace ScrumSprintMonitor.Samples.Feed.RSS
{
	#region #using Directives

	using System.ComponentModel;
	using System.Xml.Serialization;

	using Infrastructure;

	#endregion

	[XmlRoot(ElementName = "channel")]
	public class Channel : Element
	{
		private BindingList<Item> itemsList;
		public string copyright { get; set; }
		public string language { get; set; }
		public Image image { get; set; }

		[XmlElement(ElementName = "item", Type = typeof(Item))]
		public BindingList<Item> items
		{
			get { return this.itemsList; }
			set
			{
				if (value != this.itemsList)
				{
					if (this.itemsList != null)
					{
						this.itemsList.ListChanged -= itemsList_ListChanged;
					}

					this.itemsList = value;

					if (this.itemsList != null)
					{
						this.itemsList.ListChanged += itemsList_ListChanged;
					}
				}
			}
		}

		private void itemsList_ListChanged(object sender, ListChangedEventArgs e)
		{
			pubDate = string.Format("{0:R}", SystemTime.Now());
		}
	}
}